/**
 * 【案例7.2.3】改变盒子大小
 * @type {Element}
 */
var box = document.getElementsByClassName("box")[0]; //通过class名字找到class=box的元素数组
var count = 0;//设置点击次数
box.onclick = function () {
    count++;
    if (count % 2 == 1) {
        box.style.height = "200px";
        box.style.width = "200px";
        box.innerHTML = "大";
    } else {
        box.style.height = "20px";
        box.style.width = "20px";
        box.innerHTML = "小";
    }

}